﻿using Domain.Entity;
using Domain.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.AppService.CMAppService
{
    public class CMAppService : ICMAppService
    {
        private readonly ICMRepository cmRepository;

        public CMAppService(ICMRepository cmRepository)
        {
            this.cmRepository = cmRepository;
        }
        //查询全部
        public Task<List<CM>> GetCMAsync()
        {
            return cmRepository.GetCMAsync();
        }
        //新增
       public  Task<bool> AddCMAsync(CM cM)
        {
            return cmRepository.AddCMAsync(cM);
        }

        //删除
       public Task<bool> DeleteCMAsync(int id)
        {
			return cmRepository.DeleteCMAsync(id);
		}

		public Task<List<CM>> GetCMAsyncById(string id)
		{
            return cmRepository.GetCMAsyncById(id);
		}

		public Task<CM> GetCMSAsyncById(string id)
		{
			return cmRepository.GetCMSAsyncById(id);
		}
	}
}
